3.208 \(\int \frac{\tan ^m(c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=168 \[ \frac{(A (1-m)-i B (m+1)) \tan ^{m+1}(c+d x) \text{Hypergeometric2F1}\left (1,\frac{m+1}{2},\frac{m+3}{2},-\tan ^2(c+d x)\right )}{2 a d (m+1)}+\frac{m (-B+i A) \tan ^{m+2}(c+d x) \text{Hypergeometric2F1}\left (1,\frac{m+2}{2},\frac{m+4}{2},-\tan ^2(c+d x)\right )}{2 a d (m+2)}+\frac{(A+i B) \tan ^{m+1}(c+d x)}{2 d (a+i a \tan (c+d x))} \]

[Out]

((A*(1 - m) - I*B*(1 + m))*Hypergeometric2F1[1, (1 + m)/2, (3 + m)/2, -Tan[c + d*x]^2]*Tan[c + d*x]^(1 + m))/(
2*a*d*(1 + m)) + ((I*A - B)*m*Hypergeometric2F1[1, (2 + m)/2, (4 + m)/2, -Tan[c + d*x]^2]*Tan[c + d*x]^(2 + m)
)/(2*a*d*(2 + m)) + ((A + I*B)*Tan[c + d*x]^(1 + m))/(2*d*(a + I*a*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.220419, antiderivative size = 168, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.118, Rules used = {3596, 3538, 3476, 364} \[ \frac{(A (1-m)-i B (m+1)) \tan ^{m+1}(c+d x) \, _2F_1\left (1,\frac{m+1}{2};\frac{m+3}{2};-\tan ^2(c+d x)\right )}{2 a d (m+1)}+\frac{m (-B+i A) \tan ^{m+2}(c+d x) \, _2F_1\left (1,\frac{m+2}{2};\frac{m+4}{2};-\tan ^2(c+d x)\right )}{2 a d (m+2)}+\frac{(A+i B) \tan ^{m+1}(c+d x)}{2 d (a+i a \tan (c+d x))} \]

Antiderivative was successfully verified.

[In]

Int[(Tan[c + d*x]^m*(A + B*Tan[c + d*x]))/(a + I*a*Tan[c + d*x]),x]

[Out]

((A*(1 - m) - I*B*(1 + m))*Hypergeometric2F1[1, (1 + m)/2, (3 + m)/2, -Tan[c + d*x]^2]*Tan[c + d*x]^(1 + m))/(
2*a*d*(1 + m)) + ((I*A - B)*m*Hypergeometric2F1[1, (2 + m)/2, (4 + m)/2, -Tan[c + d*x]^2]*Tan[c + d*x]^(2 + m)
)/(2*a*d*(2 + m)) + ((A + I*B)*Tan[c + d*x]^(1 + m))/(2*d*(a + I*a*Tan[c + d*x]))

Rule 3596

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[((a*A + b*B)*(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1))/(2
*f*m*(b*c - a*d)), x] + Dist[1/(2*a*m*(b*c - a*d)), Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Si
mp[A*(b*c*m - a*d*(2*m + n + 1)) + B*(a*c*m - b*d*(n + 1)) + d*(A*b - a*B)*(m + n + 1)*Tan[e + f*x], x], x], x
] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0] &&  !GtQ[n,
0]

Rule 3538

Int[((b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*T
an[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Tan[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x] && NeQ
[c^2 + d^2, 0] &&  !IntegerQ[2*m]

Rule 3476

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[b/d, Subst[Int[x^n/(b^2 + x^2), x], x, b*Tan[c + d
*x]], x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 364

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(a^p*(c*x)^(m + 1)*Hypergeometric2F1[-
p, (m + 1)/n, (m + 1)/n + 1, -((b*x^n)/a)])/(c*(m + 1)), x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rubi steps

\begin{align*} \int \frac{\tan ^m(c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx &=\frac{(A+i B) \tan ^{1+m}(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{\int \tan ^m(c+d x) (a (A (1-m)-i B (1+m))+a (i A-B) m \tan (c+d x)) \, dx}{2 a^2}\\ &=\frac{(A+i B) \tan ^{1+m}(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{((i A-B) m) \int \tan ^{1+m}(c+d x) \, dx}{2 a}+\frac{(A-A m-i B (1+m)) \int \tan ^m(c+d x) \, dx}{2 a}\\ &=\frac{(A+i B) \tan ^{1+m}(c+d x)}{2 d (a+i a \tan (c+d x))}+\frac{((i A-B) m) \operatorname{Subst}\left (\int \frac{x^{1+m}}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 a d}+\frac{(A-A m-i B (1+m)) \operatorname{Subst}\left (\int \frac{x^m}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 a d}\\ &=\frac{(A-A m-i B (1+m)) \, _2F_1\left (1,\frac{1+m}{2};\frac{3+m}{2};-\tan ^2(c+d x)\right ) \tan ^{1+m}(c+d x)}{2 a d (1+m)}+\frac{(i A-B) m \, _2F_1\left (1,\frac{2+m}{2};\frac{4+m}{2};-\tan ^2(c+d x)\right ) \tan ^{2+m}(c+d x)}{2 a d (2+m)}+\frac{(A+i B) \tan ^{1+m}(c+d x)}{2 d (a+i a \tan (c+d x))}\\ \end{align*}

Mathematica [F]  time = 7.2371, size = 0, normalized size = 0. \[ \int \frac{\tan ^m(c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[(Tan[c + d*x]^m*(A + B*Tan[c + d*x]))/(a + I*a*Tan[c + d*x]),x]

[Out]

Integrate[(Tan[c + d*x]^m*(A + B*Tan[c + d*x]))/(a + I*a*Tan[c + d*x]), x]

________________________________________________________________________________________

Maple [F]  time = 1.348, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( \tan \left ( dx+c \right ) \right ) ^{m} \left ( A+B\tan \left ( dx+c \right ) \right ) }{a+ia\tan \left ( dx+c \right ) }}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^m*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x)

[Out]

int(tan(d*x+c)^m*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^m*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left ({\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + A + i \, B\right )} \left (\frac{-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{m} e^{\left (-2 i \, d x - 2 i \, c\right )}}{2 \, a}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^m*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

integral(1/2*((A - I*B)*e^(2*I*d*x + 2*I*c) + A + I*B)*((-I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) + 1)
)^m*e^(-2*I*d*x - 2*I*c)/a, x)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**m*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \tan \left (d x + c\right ) + A\right )} \tan \left (d x + c\right )^{m}}{i \, a \tan \left (d x + c\right ) + a}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^m*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

integrate((B*tan(d*x + c) + A)*tan(d*x + c)^m/(I*a*tan(d*x + c) + a), x)